
$(function () {

    initData();//初始化日期和数据
    
    $(".press_btn1").click(function () {
        alertPage();
    })
})




initData = function () {
    var date = new Date();
    //默认展示前12个小时的数据
    date.setHours(date.getHours() - 24);
    $("#startTime").val(formatDateTime(date));
    $("#endTime").val(formatDateTime(new Date()));
    alertPage();
}

alertPage = function () {
    $("#alertTable").empty();
    var startTime = $("#startTime").val();
    var endTime = $("#endTime").val();
    var columns = [{code:"timeStr", name:"时间"},
                   {code:"sendto", name:"推送邮箱"},
                   {code:"status", name:"告警状态"},
                   {code:"alerttype", name:"告警级别"},
                   {code:"subject", name:"告警主题"},
                   {code:"S", name:"操作"}];
    var param = {url: webPath + "/radar/alert/selectAlertData.do", divID: "alertTable", afterQuery:"hiddenFooterPage"};
    var data = {startTime: startTime, endTime: endTime};
    easyQuery(columns, param, data);
}

//隐藏页脚
function hiddenFooterPage() {
    $("#alertTablepageMenu").css("display", "none");
}